﻿using System;
using System.Collections.Generic;
using System.Text;
using System.Windows.Forms;

namespace _013_014_015_016_表达式_语句详解
{
    internal class Program
    {

        static void Main(string[] args)
        {

            //表达式


            //int x;
            //x = 100;

            //Action<string> myAction = new Action<string>(Console.WriteLine);//委托方法 成员函数也是方法
            //myAction("Hello World");

            //System.Windows.Forms.Form Forms = new Form();

            //var num1 = Math.Pow(2, 3);
            //Console.WriteLine(num1.GetType().FullName);

            //var number = 5 > 3 ? 2 : 3.0;
            //Console.WriteLine(number.GetType().FullName);//System.Double

            int x = 100;
            int y;
            y = x;

            Console.WriteLine((y = x));  //100
            Console.WriteLine((y = x).GetType().FullName);  //Int32

            Action<string> a = delegate(string paramter)
            {
                Console.WriteLine(paramter);
            };

            a("测试a的类型委托");

            //属性访问
            Form form = new Form();
            form.Text = "hello world";
            form.Load += Form_Load;
            form.ShowDialog();
        }

        private static void Form_Load(object sender, EventArgs e)
        {
            Form form = sender as Form;
            if(form == null)
            {
                return;
            }
            form.Text = "测试新名称空间";
        }
    }

    class Student
    {
        public int ID;
        public string Name;
    }
}
